Skip to content

Add template-apply modal and diamond action on repository panels#313

Merged
tbrandenburg merged 2 commits intomainfrom
codex/add-template-modal-dialog-to-repo-panel
Mar 27, 2026
Merged

Add template-apply modal and diamond action on repository panels#313
tbrandenburg merged 2 commits intomainfrom
codex/add-template-modal-dialog-to-repo-panel

Conversation

@tbrandenburg
Copy link
Copy Markdown
Owner

Motivation

  • Provide an easy, in-UI way to apply project templates from MADE_HOME/.made/templates/ to existing repositories using the same look-and-feel as other repo actions.
  • Implement backend support to enumerate available templates and copy template contents into a repository with overwrite semantics.
  • Keep UI simple and consistent by reusing the shared Modal component and adding a small transparent diamond icon for the action.

Description

  • Added a new DiamondIcon SVG component used as a top-right action on each repository panel to open the template modal.
  • Added a template modal in RepositoriesPage that lists templates as blue primary buttons and supports close via the existing modal ×, shows success or error alerts, and prevents closing while a template is applying.
  • Extended the frontend API (useApi) with listRepositoryTemplates and applyRepositoryTemplate methods and added a TemplateApplyResponse type.
  • Implemented backend functions list_repository_templates() and apply_repository_template(repo_name, template_name) in repository_service.py which list template folders under MADE_HOME/.made/templates/ and recursively copy template files into the target repository using shutil.copytree / shutil.copy2.
  • Added backend API endpoints GET /api/repositories/templates and POST /api/repositories/{name}/templates/apply with input validation and mapped errors to appropriate HTTP responses.
  • Added unit tests for the new backend functions and API endpoints and a frontend test exercising the modal open/list/apply flow, plus minimal CSS for layout.

Testing

  • Ran repository service unit tests with python -m pytest packages/pybackend/tests/unit/test_repository_service.py and all tests passed (17 passed).
  • Attempted to run combined backend API tests with python -m pytest packages/pybackend/tests/unit/test_repository_service.py packages/pybackend/tests/unit/test_api.py but collection failed in this environment because the fastapi package is not installed, causing an import error for test_api.py.
  • Ran the frontend unit test for the repositories page with npm --prefix packages/frontend run test -- RepositoriesPage.test.tsx and the Vitest run passed (1 file, 3 tests passed).

Codex Task

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
made Ready Ready Preview, Comment Mar 27, 2026 10:23am

@tbrandenburg tbrandenburg merged commit a3d5854 into main Mar 27, 2026
8 checks passed
@tbrandenburg tbrandenburg deleted the codex/add-template-modal-dialog-to-repo-panel branch March 27, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant